#ifndef GIFPLAINTEXTEXTENSION_H
#define GIFPLAINTEXTEXTENSION_H

#include "gifextension.h"

namespace WingGif {

class WINGEXPORT GifPlainTextExtension : public GifExtension {
  Q_OBJECT
  Q_PROPERTY(int blockSize READ blockSize)
  Q_PROPERTY(int left READ left)
  Q_PROPERTY(int top READ top)
  Q_PROPERTY(int width READ width)
  Q_PROPERTY(int height READ height)
  Q_PROPERTY(int cellWidth READ cellWidth)
  Q_PROPERTY(int cellHeight READ cellHeight)
  Q_PROPERTY(int foregroundColorIndex READ foregroundColorIndex)
  Q_PROPERTY(int backgroundColorIndex READ backgroundColorIndex)
  Q_PROPERTY(QString text READ text)
  Q_PROPERTY(QList<GifExtension *> extensions READ extensions)

public:
  int blockSize();
  int left();
  int top();
  int width();
  int height();
  int cellWidth();
  int cellHeight();
  int foregroundColorIndex();
  int backgroundColorIndex();
  QString text();
  QList<GifExtension *> extensions();

  bool read(QIODevice *stream,
            QList<GifExtension *> controlExtensions) override;
  GifBlockKind kind() override;

  GifPlainTextExtension(QObject *parent = nullptr);

private:
  int _blockSize;
  int _left;
  int _top;
  int _width;
  int _height;
  int _cellWidth;
  int _cellHeight;
  int _foregroundColorIndex;
  int _backgroundColorIndex;
  QString _text;
  QList<GifExtension *> _extensions;
};

} // namespace WingGif

#endif // GIFPLAINTEXTEXTENSION_H
